package mapper.resim;

import java.util.ArrayList;

import mapper.dbinterface;
import mapper.iMapper;
import mapper.adress.db2MapperAdres;
import mapper.adress.mySqlMapperAdres;

public class ResimMapper implements iMapper{
	private dbinterface DataBases;
	public ResimMapper() {
		config.Config.maine();
		if (config.Config.prop.getProperty("server.database").toLowerCase() == "mysql"){
			if (DataBases == null){
				DataBases = (dbinterface) new mySqlMapperAdres();
			}
		}
		else{
			if (DataBases == null){
				DataBases = (dbinterface) new db2MapperAdres();
			}	
		// TODO Auto-generated constructor stub
		}
	}
	@Override
	public boolean delete(Object oid) {
		// TODO Auto-generated method stub
		return DataBases.DataBaseDeleteObject(oid);
	}

	@Override
	public ArrayList<Object> get(Object oid) {
		// TODO Auto-generated method stub
		return (ArrayList) DataBases.DataBaseGetObject(oid);
		
	}

	@Override
	public boolean put(Object oid) {
		// TODO Auto-generated method stub
		return DataBases.DataBasePut(oid);
	}

	@Override
	public boolean update(Object oid) {
		// TODO Auto-generated method stubs
		return DataBases.DataBaseUpdate(oid);
	}
}
